#ifndef ROOM_HH
#define ROOM_HH

#include <string>
#include <vector>
#include <map>
#include "Item.hh"
#include "ICharacter.hh"

// Room class, used to represent locations in the game
class Room 
{
private:
    std::string name;                          // Room name
    std::string description;                   // Room description
    std::map<std::string, Room*> exits;        // Room exits, using map data type, similar to python's dictionary
    std::vector<Item*> items;                  // Items in the room
    std::vector<ICharacter*> enemies;          // Enemies in the room
public:
    // Constructor and destructor
    Room(const std::string& name, const std::string& description);
    Room(const Room& other) = default;
    Room& operator=(const Room& other) = default;
    ~Room();

    // Set and get room exits
    void setExit(const std::string& direction, Room* neighbor);
    Room* getExit(const std::string& direction) const;
    std::string getExitsString() const;

    // Item management
    void addItem(Item* item);
    Item* takeItem(const std::string& itemName);
    std::string getItemsString() const;

    // Enemy management
    void addEnemy(ICharacter* enemy);
    ICharacter* getEnemy(const std::string& enemyName);
    std::string getEnemiesString() const;
    void removeEnemy(ICharacter* enemy);

    // Display detailed information about the room
    void display() const;
    std::string getName() const;

    // Operator overloading: use operator[] to access adjacent rooms directly by direction
    Room* operator[](const std::string& direction);
};

#endif 
